package services;

import domain.entities.IrbSop;

/**
 * Created with IntelliJ IDEA.
 * User: Guillermo
 * Date: 09/08/12
 * Time: 15:03
 * To change this template use File | Settings | File Templates.
 */
public class CriteriaIrbSop extends Criteria{

    private IrbSop irb;

    public CriteriaIrbSop(IrbSop irb){
        this.irb = irb;
    }

    @Override
    public boolean isIn(Object element){
        boolean isIn = true;
        IrbSop other = (IrbSop)element;

        isIn &= (irb.getComiteEtica() == null ||
                irb.getComiteEtica().getId() == null ||
                irb.getComiteEtica().getId().equals(other.getComiteEtica().getId()));

        return isIn;
    }
}
